package cmd

import (
	"gitee.com/xuyiping_admin/pkg/svcutil"
	"kpt-dtm/config"
	"kpt-dtm/dep"

	"github.com/spf13/cobra"
)

// crontabCmd represents the crontab command
var crontabCmd = &cobra.Command{
	Use:   "crontab",
	Short: "内部定时任务",
	Run: func(cmd *cobra.Command, args []string) {
		svcutil.WaitFor(config.Options().HTTPServerAddr, func(stop <-chan struct{}) error {
			dep.CommonCrontab().Run(stop)
			return nil
		})
	},
}
